package com.woniuxy.yogaapp.mapper;

import com.woniuxy.yogaapp.pojo.User;
import com.woniuxy.yogaapp.pojo.UserRoles;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
 * 操作power表
 */
public interface UserRolesMapper {

	/**
	 * 根据uid查询用户的角色
	 * 
	 * @param uid
	 * @return
	 */
	@Select("select * from userroles where uid=#{uid}")
	UserRoles findRolesByUid(Integer uid);

	/**
	 * 添加用户角色
	 */
	@Insert("insert into userroles  values(#{uid},#{rid})")
	public int addStudentRoles(UserRoles userRoles);

	/**
	 * 删除改用户原有角色
	 * @param userRoles
	 * @return
	 */
	@Delete("delete from userroles where uid=#{uid}")
	public int deleteRoles(UserRoles userRoles);

	
	/**
	 * 删除改用户原有角色
	 * @param userRoles
	 * @return
	 */
	@Delete("delete from userroles where uid=#{uid}")
	public int deleteRoles1(int uid);

}
